package com.lifesaftypower.activity;

import java.util.Arrays;

import android.os.Bundle;
import android.support.v4.app.ListFragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ListView;

import com.lifesaftypower.adapter.SolutionAdapter;
import com.lifesaftypower.entity.Product;

public class SolutionListFragment extends ListFragment {
	public static final String INTENT_SOLUTION = "INTENT_SOLUTION";
	private ListView _listView;
	private SolutionAdapter _adapter;

	@Override
	public void onActivityCreated(Bundle savedInstanceState) {

		super.onActivityCreated(savedInstanceState);
		_listView.setAdapter(_adapter);
	}

	@Override
	public void onCreate(Bundle savedInstanceState) {

		super.onCreate(savedInstanceState);
		_adapter = new SolutionAdapter(this.getActivity(),
				R.layout.solution_list_item, Arrays.asList(Product.getSector()));
	}

	@Override
	public View onCreateView(LayoutInflater inflater, ViewGroup container,
			Bundle savedInstanceState) {
		// Bundle extra = this.getActivity().getIntent().getExtras();

		// List<Solution> solutions = (List<Solution>)
		// (extra.getSerializable(INTENT_SOLUTION));
		View v = inflater.inflate(
				R.layout.fragment_solution_list, container, false);

		_listView = (ListView) v.findViewById(android.R.id.list);

		return v;
	}

	@Override
	public void onPause() {
		super.onPause();
	}

}
